#! /bin/sh
#
# mdev start script
# Written by Linus Walleij

case "$1" in
    start)
	# fstab and mount -a has already provides procfs and sysfs
	# and devpts /dev/pts at this point
	echo -n "mounting tmpfs at /dev ..."
	mount -t tmpfs tmpfs /dev -o mode=755
	echo "done"
	echo -n "mounting pts at /dev/pts ..."
	mkdir /dev/pts
	mount -t devpts devpts /dev/pts
	echo "done"
	# udev needs /dev/null to start...
	# mknod -m 666 /dev/null c 1 3
	# mdev will be called by the kernel to handle hotplugs
	echo /sbin/mdev > /proc/sys/kernel/hotplug
        # Now traverse sys/ in order to "coldplug"
        # devices that have already been discovered
        echo -n "creating initial mdev device nodes ..."
	mdev -s
	echo "done"
	exit 0
        ;;
    stop)
	;;
esac
